import { createApp } from 'vue'
import App from './App.vue'
import router from '@/router'
import pinia from '@/store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
import { setupPermissionDirective } from '@/directives/permission'
import i18n from '@/locales'
import '@/styles/animations.css'

const app = createApp(App)

// 注册所有图标
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}

// 注册权限指令
setupPermissionDirective(app)

app.use(router)
app.use(pinia)
app.use(i18n)
app.use(ElementPlus)
app.mount('#app')
